public class PowerAdapter extends AC220 implements InterfaceDC5V{

    public PowerAdapter(AC220 inputPower){
        this.ac220Input=inputPower;
    }
    public PowerAdapter(){}

    private AC220 ac220Input;

    //适配器实现5V
    @Override
    public int output5V() {

        int adapterInput =this.ac220Input.outputVoltage();//输入220v，输出5V
        System.out.println("输入:"+adapterInput+"--->输出:"+adapterInput/44+"V");

        return adapterInput/44;
    }

    //适配器实现12V
    @Override
    public int output12V() {

        int adapterInput =this.ac220Input.outputVoltage();//输入220v，输出5V
        System.out.println("输入:"+adapterInput+"--->输出:"+adapterInput/18+"V");

        return adapterInput/18;
    }

    @Override
    public int output24V() {
        return 0;
    }

    public AC220 getAc220Input() {
        return ac220Input;
    }

    public void setAc220Input(AC220 ac220Input) {
        this.ac220Input = ac220Input;
    }
}
